<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateAdminRolePermission extends Migrator
{
    public function up()
    {
        $table = $this->table('admin_role_permission', ['id' => 'id', 'comment' => '角色权限表', 'engine' => 'InnoDB', '']);
        $table->addColumn('role_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '角色'])
            ->addColumn('permission_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '权限'])
            ->create();
    }

    public function down()
    {
        $this->table('admin_role_permission')->drop();
    }
}
